﻿@model PagingList<Blog>
@{
    ViewBag.ActiveMenu = "日志";
    ViewBag.Title = "日志";
    Layout = MVC.Shared.Views._Layout;
}

<section id="page-breadcrumb">
    <div class="vertical-center sun">
        <div class="container">
            <div class="row">
                <div class="action">
                    <div class="col-sm-12">
                        <h1 class="title">日志</h1>
                        <p>畅游在书的海洋中...</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<!--/#action-->
<section id="blog" class="padding-top">
    <div class="container">
        <div class="row">
            <div class="col-md-9 col-sm-7">
                <div class="row">
                    <div class="col-sm-12 col-md-12">
                        <div class="pull-right">
                            <span>排序条件：</span>
                            @*@Html.EnumDropDownList("SortBy", Request.QueryString.Get<SortBy?>("sortBy", null))*@
                            @*@Html.DropDownList("IsActived", null, "全部", new RouteValueDictionary { { "class", "form-control" } })*@
                            <div class="btn-group">
                                <button type="button" class="btn btn-default">@(Request.QueryString.Get<SortBy?>("sortBy", SortBy.CreatedTimeDesc).EnumMetadataDisplay())</button>
                                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                    <span class="caret"></span>
                                    <span class="sr-only">排序</span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li><a href="@Url.Action(MVC.Blog.Blog.Home(sortBy:SortBy.CreatedTime))">发表时间正序</a></li>
                                    <li><a href="@Url.Action(MVC.Blog.Blog.Home(sortBy:SortBy.CreatedTimeDesc))">发表时间倒序</a></li>
                                    <li><a href="@Url.Action(MVC.Blog.Blog.Home(sortBy:SortBy.UpdatedTimeDesc))">更新时间倒序</a></li>
                                    <li><a href="@Url.Action(MVC.Blog.Blog.Home(sortBy:SortBy.HitCount))">浏览最多</a></li>
                                    <li><a href="@Url.Action(MVC.Blog.Blog.Home(sortBy:SortBy.CommentCount))">评论最多</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    @if (Model.Any())
                    {
                        foreach (var item in Model)
                        {
                            <div class="col-sm-12 col-md-12 post-content">
                                @if (!string.IsNullOrEmpty(item.FeaturedImage))
                                {
                                    <div class="col-sm-3">
                                        <a href="@Url.Action(MVC.Blog.Blog.Detail(item.Id))" title="@item.Title"><img src="@item.FeaturedImage" class="img-responsive" alt="@item.Title"></a>
                                    </div>
                                }
                                <div class="col-sm-@(string.IsNullOrEmpty(item.FeaturedImage) ? 12 : 9) overflow">
                                    <h2 class="post-title bold">
                                        <a href="@Url.Action(MVC.Blog.Blog.Detail(item.Id))" title="@item.Title">
                                            @item.Title
                                        </a>
                                    </h2>
                                    <h3 class="post-author">
                                        <a href="@Url.Action(MVC.Blog.Blog.Detail(item.Id))"><i class="fa fa-user"></i> @item.Author.NickName</a>&nbsp;&nbsp;
                                        <small><i class="fa fa-clock-o"></i> @item.CreatedTime.ToString("yyyy-MM-dd")</small> &nbsp; &nbsp;
                                        <a href="@Url.Action(MVC.Blog.Blog.Detail(item.Id))" title="评论数"><i class="fa fa-comments"></i> @item.CommentCount</a>&nbsp;&nbsp;
                                        <a href="@Url.Action(MVC.Blog.Blog.Detail(item.Id))" title="浏览数"><i class="fa fa-eye"></i> @item.HitCount</a>
                                    </h3>
                                    <p>
                                        @Html.Raw(item.Summary)...
                                    </p>
                                </div>
                            </div>
                        }
                    }
                </div>
                @Html.PagingButton(Model, PaginationMode.NumericNextPreviousFirstLast, 3)
            </div>
            <div class="col-md-3 col-sm-5">
                @Html.Partial("_Sidebar")

            </div>
        </div>
    </div>
</section>
